Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Sergio 73 posts 93 karma points
    Dec 22, 2011 @ 10:27
    Sergio
    0

    [RichTextEditor] Alt attribute in images

    Hello,

    We have created a property for the images (Media section) called "alt".

    Is there any way to use this property when a user insert a picture with the RTE?

    The alt attribute normally shows the name of the image but we need to update his behaviour to use our custom property.

  • awm 187 posts 376 karma points
    Dec 22, 2011 @ 11:04
    awm
    0

    Not sure if you can do this via the 'insert image' button but it's easily doable with a macro. You could create a document type with a media picker and textbox and use that?

  • Sergio 73 posts 93 karma points
    Dec 22, 2011 @ 11:12
    Sergio
    0

    What do you mean with using a macro? Inside the RTE?

    I can´t create a new document type because in some of our DT the users need the RTE editor and insert pictures from it.

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Dec 22, 2011 @ 11:44
    Jan Skovgaard
    0

    Hi Sergio

    When you insert images through the RTE there is an option to specify the alt text in the "insert image dialog". You fetch the alt text defined on the image in the media section here.

    If you need to do so you will need to create a macro as alimac is saying above.

    You can create a XSLT or Razor based macro, that can be inserted into the Rich text editor. It does not have anything to do with document types :)

    When you have done so in the developer section you need to specify a parameter on the created macro of the type "mediaCurrent", which gives your users the option to choose an image from the media section. Based on the image id you get returned you can grab the image and the alt text in your XSLT or Razor code and make sure it's being inserted.

    I hope this makes sense.

    /Jan

  • Sergio 73 posts 93 karma points
    Dec 22, 2011 @ 12:08
    Sergio
    0

    Thanks Jan.

    I´ll try to do this with a macro. It seems smarter than my first idea that was explained in this other post: http://our.umbraco.org/forum/using/ui-questions/4406-Insert-of-image-description-in-RTE

     

Please Sign in or register to post replies

Write your reply to:

Draft